<!DOCTYPE html>
<html lang='en'>

<head>
    <meta charset='UTF-8'>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>canvas画板v1(基础版)</title>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/4.1.1/animate.min.css">
    <style>
        * {
            padding: 0px;
            margin: 0px;
        }

        html,
        body {
            height: 100%;
            width: 100%;
        }

        html {
            touch-action: none;
        }

        canvas {
            position: fixed;
            display: block;
            cursor: url('./images/black.ico'),pointer;
        }

        .util {
            position: absolute;
            top: 10px;
            left: 10px;
            padding: 10px;
            border-radius: 10px;
            z-index: 2;
        }

        .check-color {
            outline: none;
            border: none;
            width: 40px;
            height: 40px;
            display: block;
            border-radius: 100%;
        }

        #linwidth {}

        [type="range"] {
            -webkit-appearance: none;
            appearance: none;
            margin: 0;
            outline: 0;
            background-color: transparent;
            width: 100px;
        }

        [type="range"]::-webkit-slider-runnable-track {
            height: 4px;
            background: #eee;
        }

        [type="range"i]::-webkit-slider-container {
            height: 20px;
            overflow: hidden;
        }

        [type="range"]::-webkit-slider-thumb {
            -webkit-appearance: none;
            appearance: none;
            width: 20px;
            height: 20px;
            border-radius: 50%;
            background-color: rgb(138, 43, 226);
            border: 1px solid transparent;
            margin-top: -8px;
            border-image: linear-gradient(rgb(138, 43, 226),rgb(138, 43, 226)) 0 fill / 8 20 8 0 / 0px 0px 0 2000px;
        }
        .util {
            background-color: #fff;
            box-shadow: 0px 0px 10px #ccc;
            user-select: none;
        }
        .pen {
            
        }
        .mode {
            font-size: 13px;
            color: #6c6a6a;
        }
        .clear-all {
            width: 32px;
            height: 32px;
            margin-top: 5px;
        }
        .save {
            width: 32px;
            height: 32px;
        }
        .dialog {
            min-width: 280px;
            display: none;
            position: fixed;
            z-index: 33;
            margin: 0 auto;
            top: 5%;
            left: 50%;
            justify-content: space-around;
            align-items: center;
            padding: 10px 20px;
            background-color: #fff;
            box-shadow: 0px 0px 10px #ccc;
            border-radius: 10px;
        }
        @keyframes fadeInDown{
            0% {
                opacity: 0;
                -webkit-transform:translate3d(-50%,-100%,0);
            }
            100%{
                opacity: 1;
                -webkit-transform: translate3d(-50%,0%,0);
            }
        }
        .bottom-btns {
            display: flex;
            align-items: center;
            margin: 0px 0px 0px 15px;
        }
        .cancel,.confirm {
            cursor: pointer;
            outline: none;
            border: none;
            background-color: rgba(176, 175, 175, 0.131);
            transition: .2s all;
            padding: 5px 12px;
            border-radius: 6px;
            margin-left: 10px;
        }
        .confirm {
            background-color: rgba(137, 43, 226, 0.712);
            color: #fff;
        }
        .cancel:hover {
            background-color: rgba(176, 175, 175, 0.447);
        }
        .confirm:hover {
            background-color: rgb(148, 72, 219);
        }
    </style>
</head>

<body>
    <div class="util">
        <p>选择画笔颜色</p>
        <input type="color" value="#8A2BE2" class="check-color" name="" id="lincolor" />
        <p>选择画笔的粗细</p>
        <input type="range" id="linwidth" value="50" name="">
        <div class="pen-xp">
            <img src="./images/black.ico" class="pen" alt="画笔" srcset="">
            <img src="./images/xiangpica.ico" class="xiangpica" alt="橡皮擦" srcset="">
            <p class="mode">当前模式:画笔模式</p>
            <img src="./images/clearAll.png" class="clear-all" alt="清空画布" srcset="">
            <!-- <br> -->
            <img src="./images/save.png" class="save" alt="保存图片" srcset="">
        </div>
    </div>
    <!-- 弹窗 fadeInUp-->
    <div class="dialog animate__animated animate__fadeInDown"> 
        <div class="top">
            <p>确认执行当前操作?</p>
        </div>
        <div class="bottom-btns">
            <button class="cancel">取消</button>
            <button class="confirm">确认</button>
        </div>
    </div>
    <canvas id="canvas"></canvas>
    <script src="./canvas画板.js">
    </script>
</body>

</html>